<template>
	<div class="my-news">
		<commentsList :data="commentsData" ></commentsList>
		<div v-if="commentsData.length === 0" class="no-data">
			<img src="../../assets/image/noData.png" >
			<p>还没有人给您评论！</p>
		</div>
	</div>
</template>

<script lang="ts" setup>
	import commentsList from '../../component/commentsList.vue'
	import {cachLoading} from '../../public/common'
	import {HttpMyComments} from '../../public/http'
	import {onMounted,ref} from 'vue'
	
	let commentsData:any = ref([])
	
	const releaseMain = ()=>{
		if(cachLoading('commentsData')){
			commentsData.value = cachLoading('commentsData')
		}
		HttpMyComments().then((res:any)=>{	
			if(res.code === 200){
				cachLoading('commentsData',res.data.myCommentsData)
				commentsData.value = res.data.myCommentsData
			}
		})
	}
	
	onMounted(()=>{
		releaseMain()
	})
</script>

<style lang="scss">
	.my-news{
		width: 100%;
		height: calc(100%);
		overflow: auto;
		background: #efedee;
		padding: 10px 10px 0 10px;
		box-sizing: border-box;
		
	}
</style>
